package com.fancy.learncenter.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.fancy.learncenter.R;
import com.fancy.learncenter.ui.adapter.base.CommonRecycleViewAdapter;
import com.fancy.learncenter.ui.adapter.base.CustomViewHold;

import java.util.List;

/**
 * Created by shiweiwei on 2017/12/11.
 */

public class EnglishLettersAdapter extends CommonRecycleViewAdapter<String>{


    public void setListener(ClickListener listener) {
        this.listener = listener;
    }

    ClickListener listener;

    public EnglishLettersAdapter(Context mContext, List<String> itemDatas) {
        super(mContext, R.layout.english_letters_item_layout, itemDatas);
    }

    @Override
    public void bindView(CustomViewHold customViewHold, final String item, final int position) {

        TextView letter_text = customViewHold.getView(R.id.letter_text);

        letter_text.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (listener != null){
                    listener.click(item,position);
                }
            }
        });

    }


   public interface ClickListener{
        void click(String value,int position);
    }
}
